package cn.stylefeng.guns.sys.modular.system.mapper;

import cn.stylefeng.guns.sys.modular.system.entity.ZxYusuan;
import cn.stylefeng.guns.sys.modular.system.model.params.ZxYusuanParam;
import cn.stylefeng.guns.sys.modular.system.model.result.ZxYusuanResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 装修预算表 Mapper 接口
 * </p>
 *
 * @author jiangge
 * @since 2020-11-02
 */
public interface ZxYusuanMapper extends BaseMapper<ZxYusuan> {

    /**
     * 获取列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    List<ZxYusuanResult> customList(@Param("paramCondition") ZxYusuanParam paramCondition);

    /**
     * 获取map列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") ZxYusuanParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    Page<ZxYusuanResult> customPageList(@Param("page") Page page, @Param("paramCondition") ZxYusuanParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author jiangge
     * @Date 2020-11-02
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") ZxYusuanParam paramCondition);

    List<Map<String, Object>> listExport(@Param("btyZxMdzxId") Long btyZxMdzxId);

    /**
     * 查询对应门店的预算数据
     * @param btyZxMdzxId
     * @return
     */
    List<ZxYusuanResult> selectListByBtyZxMdzxId(@Param("btyZxMdzxId") Long btyZxMdzxId);

    List<ZxYusuanResult> selectListByBtyZxMdzxIds(@Param("btyZxMdzxIds") String [] btyZxMdzxIds);

    BigDecimal getSumOfYuSuan(@Param("btyZxMdzxId") Long btyZxMdzxId);

    List<ZxYusuanResult> listYusuanInfoBymdzx(@Param("btyZxMdzxId") Long btyZxMdzxId);

    boolean batchAdd(@Param("list") List<ZxYusuan> list);

    Integer selectCountByBtyZxMdzxId(@Param("param") ZxYusuanParam zxYusuanParam);

    List<ZxYusuanResult> listYusuantemplate();
    boolean updateByDanjia( @Param("btyZxYusuanId")Long btyZxYusuanId);
    boolean updateByYusuan(@Param("param") ZxYusuan zxYusua);


    List<ZxYusuanResult> listYusuantemplateByPinpai(@Param("pinpai") Long pinpai);
}
